#ifndef _2_93_H
#define _2_93_H

typedef unsigned float_bits;

/* Compute 0.5*f. If f is NaN, then return f. */
float_bits float_half(float_bits f){
    float_bits sign = f >> 31;
    float_bits exp = f >> 23 & 0xFF;
    float_bits frac = f    & 0x7FFFFF;

    float_bits result = f;
    bool isNaN = (exp == 0xFF) && (frac != 0);

    isNaN || (exp == 0 && (result = sign << 31 | exp << 23 | frac >> 1))
          || (result = sign << 31 | (exp - 1) << 23 | frac);

    return result;
}
#endif // _2_93_H

